package blackberry.info;


import net.rim.device.api.system.DeviceInfo;
import net.rim.device.api.system.Display;

public class DjDeviceResolutions {

	//Bold99xx
	public static final int RESOLUTION_640_X_480 = 0;
	//Bold, Curve, Tour
	public static final int RESOLUTION_480_X_360 = 1;
	//Bold9000
	public static final int RESOLUTION_480_X_320 = 2; //가로 비율이 가장 길음
	
	//Torch
	public static final int RESOLUTION_480_X_800 = 3; //세로 비율이 가장 길음
	//Torch9810
	public static final int RESOLUTION_480_X_640 = 4;
	
	//Curve, 8800
	public static final int RESOLUTION_320_X_240 = 5;
	
	//Pearl, Style
	public static final int RESOLUTION_360_X_400 = 6;
	//Pearl
	public static final int RESOLUTION_240_X_260 = 7;
	
	//Torch9800, Curve9380, Storm, Storm2, 
	public static final int RESOLUTION_360_X_480 = 8;
	
	
	public static int getResolution() {
		
		int width = Display.getWidth();
		int height = Display.getHeight();
		
		if (width == 640 && height == 480) 
			return RESOLUTION_640_X_480;
		
		
		else if (width == 480)
			
			if (height == 360)
				return RESOLUTION_480_X_360;
		
			if (height == 320)
				return RESOLUTION_480_X_320;
		
			if (height == 800)
				return RESOLUTION_480_X_800;
		
			if (height == 640)
				return RESOLUTION_480_X_640;
		
		
		else if (width == 320 && height == 240)
			return RESOLUTION_320_X_240;
		
		
		else if (width == 360 && height == 400)
			return RESOLUTION_360_X_400;
		
		
		else if (width == 240 && height == 260)
			return RESOLUTION_240_X_260;
		
		
		else if (width == 360 && height == 480)
			return RESOLUTION_360_X_480;
		
		return -1;
	}
	
//	public static int getResolution() {
//		
//		String name = DeviceInfo.getDeviceName();
//		
//		if (name == DeviceNames.BOLD_9900 || name == DeviceNames.BOLD_9930  
//				|| name == DeviceNames.BOLD_9981) 
//			return RESOLUTION_640_X_480;
//		
//		
//		else if (name == DeviceNames.BOLD_9790 || name == DeviceNames.BOLD_9788 
//				|| name == DeviceNames.BOLD_9780 || name == DeviceNames.BOLD_9700
//				|| name == DeviceNames.BOLD_9650 || name == DeviceNames.CURVE_3G_9620
//				|| name == DeviceNames.CURVE_3G_9370 || name == DeviceNames.CURVE_3G_9360
//				|| name == DeviceNames.CURVE_3G_9350 || name == DeviceNames.CURVE_8980
//				|| name == DeviceNames.CURVE_8910 || name == DeviceNames.CURVE_8900 
//				|| name == DeviceNames.TOUR_9630) 
//			return RESOLUTION_480_X_360;
//		
//		
//		else if (name == DeviceNames.BOLD_9000)
//			return RESOLUTION_480_X_320;
//		
//		
//		else if (name == DeviceNames.TORCH_9860 || name == DeviceNames.TORCH_9850)
//			return RESOLUTION_480_X_800;
//		
//		
//		else if (name == DeviceNames.TORCH_9810)
//			return RESOLUTION_480_X_640;
//		
//		
//		else if (name == DeviceNames.CURVE_3G_9330 || name == DeviceNames.CURVE_3G_9320 
//				|| name == DeviceNames.CURVE_3G_9315 || name == DeviceNames.CURVE_3G_9310 
//				|| name == DeviceNames.CURVE_3G_9300 || name == DeviceNames.CURVE_3G_9220 
//				|| name == DeviceNames.CURVE_8530 || name == DeviceNames.CURVE_8520 
//				|| name == DeviceNames.CURVE_8350 || name == DeviceNames.CURVE_8330 
//				|| name == DeviceNames.CURVE_8320 || name == DeviceNames.CURVE_8310 
//				|| name == DeviceNames.CURVE_8300 || name == DeviceNames.OLD_8830 
//				|| name == DeviceNames.OLD_8820 || name == DeviceNames.OLD_8800)
//			return RESOLUTION_320_X_240;
//		
//		
//		else if (name == DeviceNames.PEARL_3G_9100 || name == DeviceNames.PEARL_3G_9105
//				|| name == DeviceNames.STYLE_9670)
//			return RESOLUTION_360_X_400;
//		
//		
//		else if (name == DeviceNames.PEARL_8130 || name == DeviceNames.PEARL_8120 
//				|| name == DeviceNames.PEARL_8110 || name == DeviceNames.PEARL_8100 )
//			return RESOLUTION_240_X_260;
//		
//		
//		else if (name == DeviceNames.TORCH_9800 || name == DeviceNames.CURVE_3G_9380 
//				|| name == DeviceNames.STORM2_9550 || name == DeviceNames.STORM2_9520 
//				|| name == DeviceNames.STORM_9530 || name == DeviceNames.STORM_9500 
//				|| name == DeviceNames.TORCH_9800 || name == DeviceNames.TORCH_9800 )
//			return RESOLUTION_360_X_480;
//		
//		
//		return -1;
//	}
}
